home *** CD-ROM | disk | FTP | other *** search
Wrap
Text File | 1992-11-18 | 51.5 KB | 1,451 lines | [ TEXT/MPS ]
C.S.M.P. Digest Sun, 08 Mar 92 Volume 1 : Issue 8 Today's Topics: Resource Editor for Balloon Help MPW C 3.2 usaes an undocumented instruction... CopyBits compile time error, Tech Note 41... Syntax error in OOPS.h Highlighting a text selection Sound Driver vs. Sound Manager What happen to the GNU C compiler for MPW? Mac Applications programming Think C v5 and Capps' libraries Logo for the Mac? Mac Programming Primer Update for Think C 5.0 pascal source to look at Need routine to convert from double to extended. BinHex 4.0 Traps question The Comp.Sys.Mac.Programmer Digest is moderated by Michael A. Kelly. These digests are available (by using FTP, account anonymous, your email address as password) in the pub/mac directory on ftp.cs.uoregon.edu. This is also the home of the comp.sys.mac.programmer Frequently Asked Questions list. The articles in these digests are taken directly from comp.sys.mac.programmer. They are not edited; all articles included in this digest are in their original posted form. The only articles that are -not- included in these digests are those which didn't receive any replies (except those that give information rather than ask a question). All replies to each article are concatenated onto the original article in the order in which they were received. Article threads are not added to the digests until the last article added to the thread is at least one month old (this is to ensure that the thread is dead before adding it to the digests). Send administrative mail to mkelly@cs.uoregon.edu. ------------------------------------------------------- From: weinstoc@sei.cmu.edu (Chuck Weinstock) Subject: Resource Editor for Balloon Help Date: 4 Feb 92 15:13:05 GMT Organization: The Software Engineering Institute Is there a resource editor for balloon help? If not how do you add the various balloon help resources to your resource fork? I tried running the example from IM through RMaker and it gets an error. Thanks. Chuck Weinstock Chuck Weinstock weinstock@sei.cmu.edu Software Engineering Institute (412) 268-7719 Carnegie Mellon University (412) 268-5758 (Fax) Pittsburgh, PA 15213 - ------------------------- From: rfl@oddjob.uchicago.edu (Bob Loewenstein) Subject: Resource Editor for Balloon Help Date: 4 Feb 92 19:43:25 GMT Organization: U. of Chicago, Astronomy and Astrophysics Check out Resorcerer, available from Mathemaesthetics, Inc. 1-617-7388803. It supports balloon help, color and styles in dialogs, and many other nice features not found in ResEdit. There are some minor problems, but overall, it is worth the money. --------------------------- From: skelmir@rhi.hi.is (Mimir Reynisson) Subject: MPW C 3.2 usaes an undocumented instruction... Date: 1 Feb 92 19:38:45 GMT Organization: University of Iceland Ok. Ok. I know that sounds like a lot of hassle but so far it is true. Anyway here is the story uncut and uncensored: I had decided to port over a quite large application from the unix environment and let it run on a tty console on the Mac (commonly know as a text window). Apart from problems with SIOW which I later resolved by replacing it completely, I ran into the following problem when the program was run under an 68000 machine. An illegal instruction. Now. That is not so unusual so I started on my way to examine my program. Considering what it could be: maybe I was jumping somewhere illegal, or maybe there was something wrong with the console, or maybe the program was simply too large for a Mac SE (because it was compiled with -model far) but the MPW documentation said that should be a NULL problemos. Ah well .. In the end I actually looked at my TMON screen and what I saw there somewhat puzzled me. TST.B #0 ?? What a stupid instruction .. Testing a constant?? Hmm... weird .. mind you this is what my Mac II said. After I installed the new version of TMON on the Mac SE, I saw TST.B #0 as well there. Hmm .. very weird.. so of I go and look into my Motorola bible and then I almost had a stroke. Eh? The holy book said there was no such instruction, no immediate addressing mode for TST.. which I admit makes sense. It was obvious of course that what they wanted to do was set the Z flag and for some unexplained reason the TST.B #0 had just popped out of the Twilight zone to do just that. Now everytime I compile the program I have to manually replace all occurances of TST.B #0 with MOVE.W #4,CCR (which does a bit more but who cares if I clear the X flag). Ah well .. life's a bitch and then you have undocumented instructions... - ------------------------- From: dorner@pequod.cso.uiuc.edu (Steve Dorner) Subject: MPW C 3.2 usaes an undocumented instruction... Date: 5 Feb 92 18:21:42 GMT Organization: University of Illinois at Urbana-Champaign skelmir@rhi.hi.is (Mimir Reynisson) writes: >Now everytime I compile the program I have to manually replace all >occurances of TST.B #0 with MOVE.W #4,CCR (which does a bit more but >who cares if I clear the X flag). Under what conditions did MPW C generate this TST.B instruction? What is the C code doing at the time? -- Steve Dorner, U of Illinois Computing Services Office Internet: s-dorner@uiuc.edu UUCP: uunet!uiucuxc!uiuc.edu!s-dorner Apparently-To: does more harm than good. - ------------------------- From: kaufman@Xenon.Stanford.EDU (Marc T. Kaufman) Subject: MPW C 3.2 usaes an undocumented instruction... Date: 5 Feb 92 21:36:25 GMT Organization: Computer Science Department, Stanford University. In article <4517@krafla.rhi.hi.is> skelmir@rhi.hi.is (Mimir Reynisson) writes: >An illegal instruction. >In the end I actually looked at my TMON screen and what I saw there somewhat >puzzled me. TST.B #0 ?? What a stupid instruction .. Testing a constant?? >Hmm... weird .. mind you this is what my Mac II said. After I installed >the new version of TMON on the Mac SE, I saw TST.B #0 as well there. >Hmm .. very weird.. so of I go and look into my Motorola bible and then I >almost had a stroke. Eh? The holy book said there was no such instruction, >no immediate addressing mode for TST.. which I admit makes sense. What was the Hex? TST.B #0 should be 4a3c 0000 On the 68020, TST.W #0 is legal, and should be 4a7c 0000 Marc Kaufman (kaufman@cs.stanford.edu) - ------------------------- From: dorner@pequod.cso.uiuc.edu (Steve Dorner) Subject: MPW C 3.2 usaes an undocumented instruction... Organization: University of Illinois at Urbana-Champaign Date: Thu, 6 Feb 1992 15:40:31 GMT I wrote: >Under what conditions did MPW C generate this TST.B instruction? What >is the C code doing at the time? I have received a reply in the mail, and the author asked me to post it. Date: Thu, 6 Feb 1992 13:52:30 +0100 To: dorner@pequod.cso.uiuc.edu From: Christophe Meessen <Meessen@slig.ucl.ac.be> Here is for the X time the explanation discovered while debugging NewsWatcher which bombs when trying to post or respond to an article on 68000 Macs. 68030 ignores this unimplemented TST instructions. In fact MPW 3.2 C compiler produces a TST on an immediate value which Motorola didn't implement. This ivalid instruction is produced when the following logical expression is encountered: (<logical expression>) && (<instructions>,<constant value>) The C compiler will try to evaluate these expression and thus will produce a TST on the <constant value> sample which produce the unimplemented instruction: #define true 1 main(){ short i; if ( (i = 1, true) && ( i == 1)); } The presence of the second logical expression is "needed" otherwise, the C compiler will optimize and remove the test correctly. The instruction is 'easy to recognize' : 4A xxxxx100 TST #immediate The Patch to NewsWatcher is Replace in resource CODE ID:5 "Lowlevel" the byte sequence 4ABC 0000 0001 6734 by 4E71 4E71 4E71 4E71 Christophe MEESSEN -- Steve Dorner, U of Illinois Computing Services Office (He who has done nothing for UIUC students, except harass them.) Internet: s-dorner@uiuc.edu UUCP: uunet!uiucuxc!uiuc.edu!s-dorner - ------------------------- From: kaufman@Xenon.Stanford.EDU (Marc T. Kaufman) Subject: MPW C 3.2 usaes an undocumented instruction... Date: 6 Feb 92 16:47:47 GMT Organization: CS Department, Stanford University, California, USA dorner@pequod.cso.uiuc.edu (Steve Dorner) writes: >I wrote: ->Under what conditions did MPW C generate this TST.B instruction? What ->is the C code doing at the time? >I have received a reply in the mail, and the author asked me to post it. >68030 ignores this unimplemented TST instructions. No, it doesn't. The 68020 and 68030 allow tst.w #const and tst.l #const as valid instructions. The only disallowed instruction is tst.b #const. >In fact MPW 3.2 C compiler produces a TST on an immediate value which >Motorola didn't implement. on the 68000 it is unimplemented. If you didn't have the -68020 flag on when compiling, the compiler probably has the instruction marked as the wrong class. >This ivalid instruction is produced when the following logical expression >is encountered: > (<logical expression>) && > (<instructions>,<constant value>) >The C compiler will try to evaluate these expression and thus will produce >a TST on the <constant value> >The instruction is 'easy to recognize' : >4A xxxxx100 TST #immediate >The Patch to NewsWatcher is >Replace in resource CODE ID:5 "Lowlevel" >the byte sequence > 4ABC 0000 0001 6734 Note that this is a TST.L #1 >by > 4E71 4E71 4E71 4E71 > Christophe MEESSEN -- Marc Kaufman (kaufman@CS.Stanford.EDU) --------------------------- From: mbp@generali.harvard.edu (Mark B Palmerino) Subject: CopyBits compile time error, Tech Note 41... Date: 4 Feb 92 17:41:07 GMT Organization: Harvard University, Cambridge, MA Hi, I'm having a problem with getting CopyBits to work as explained in Tech Note 41. I seem to be running into a compiler error as C++ gets to the actual CopyBits command. I've enclosed below the C++ fragment that includes the CopyBits call and the error as reported by MPW. The error is quite cryptic but I was hoping someone might have an idea of what I'm doing wrong. The error, which is shown in context below, is: ...line 96 # internal << CFront Version 1.0 (9/11/90; AT&T 2.0) )Apple Computer, Inc. 1989-90 >> error: check(13194728, 0, 136) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ What does "error: check(13194728, 0, 136)" refer to??? Thanks in advance for all your help. Boolean TPICTDoc::DrawRSD(Rect *r) { GrafPtr offscreen; /* our off-screen bitmap */ Rect ovalRect; /* used for example drawing */ Rect OSRect; /* portRect and bounds for off-screen bitmap*/ if (!CreateOffscreenBitMap(&offscreen, &fDocWindow->portRect)) { SysBeep(1); ExitToShell(); } /* Example drawing to our off-screen bitmap*/ SetPort(offscreen); OSRect = offscreen->portRect; /* offscreen bitmap's local coordinate rect */ ovalRect = OSRect; FillOval(&ovalRect, qd.black); InsetRect(&ovalRect, 1, 20); FillOval(&ovalRect, qd.white); InsetRect(&ovalRect, 40, 1); FillOval(&ovalRect, qd.black); /* copy from the off-screen bitmap to the on-screen window. Note that in this case the source and destination rects are the same size and both cover the entire area. These rects are allowed to be portions of the source and/or destination and do not have to be the same size. If they are not the same size then _CopyBits scales the image accordingly. */ SetPort(fDocWindow); CopyBits(&offscreen->portBits, &(*fDocWindow).portBits, &offscreen->portRect, &(*fDocWindow).portRect, srcCopy, 0L); /* * Note: fDocWindow is a window that is created by my application * in the following manner: Boolean TDoc::MakeWindow(Boolean coloWindow) { if (coloWindow) fDocWindow = GetNewCWindow(GetWinID(),nil,(WindowPtr) -1); else fDocWindow = GetNewWindow(GetWinID(),nil,(WindowPtr) -1); return (fDocWindow != nil); } * */ DestroyOffscreenBitMap(offscreen); /* dump the off-screen bitmap */ return true; } # 12:20:38 PM ----- Build of mmview. # 12:20:38 PM ----- Analyzing dependencies. # 12:20:42 PM ----- Executing build commands. CPlus ::MMView:draw.cp -o ::MMView:draw.cp.o -sym off -i ... (etc.) Set Echo 0 File "::MMView:draw.cp"; line 96 # internal << CFront Version 1.0 (9/11/90; AT&T 2.0) )Apple Computer, Inc. 1989-90 >> error: check(13194728, 0, 136) ### MPW Shell - Execution of mmview.makeout terminated. ### MPW Shell - Execution of BuildProgram terminated. The error I get is: error: check(13194728, 0, 136) What in the world does this mean? What can I do to solve the problem? Line 96 is the CopyBits command in the above code. Help! -- Mark Palmerino mbp@wjh12.harvard.edu Voice: (617) 345-9500 - ------------------------- From: ksand@apple.com (Kent Sandvik) Subject: CopyBits compile time error, Tech Note 41... Date: 6 Feb 92 17:59:00 GMT Organization: MacDTS Mongols In article <1992Feb4.174107.10473@burrhus.harvard.edu>, mbp@generali.harvard.edu (Mark B Palmerino) writes: > SetPort(fDocWindow); > CopyBits(&offscreen->portBits, &(*fDocWindow).portBits, > &offscreen->portRect, &(*fDocWindow).portRect, srcCopy, 0L); ^^ change to O > The error I get is: > error: check(13194728, 0, 136) > > What in the world does this mean? What can I do to solve the problem? > Line 96 is the CopyBits command in the above code. This is the infamous 0L bug that people using MPW C++ encounters now and then. Change the value to 0 or a constant and it should go away. As for the error message, ask the boys&girls at AT&T why they like cryptic messages :-). Kent Sandvik --------------------------- From: umduddr0@ccu.umanitoba.ca (Brendan Duddridge) Subject: Syntax error in OOPS.h Date: 4 Feb 92 18:43:46 GMT Organization: University of Manitoba, Winnipeg, Canada I am trying to use Object Oriented Programming in Think C 5.0.1. However, I seem to have a syntax error in my oops.h file. The first line has the syntax error. It goes like this: void *new(void *); And Think C seems to think this is a syntax error. I am just a beginning C programmer, so I don't really even know if there's a syntax error here or not. Can anyone help me with this? Thanx... -- Brendan Duddridge InterNet : umduddr0@ccu.umanitoba.ca America Online : BrendanD1 - ------------------------- From: umduddr0@ccu.umanitoba.ca (Brendan Duddridge) Subject: Syntax error in OOPS.h Date: 4 Feb 92 20:49:06 GMT Organization: University of Manitoba, Winnipeg, Canada >I am trying to use Object Oriented Programming in Think C 5.0.1. However, I correction -----> C 5.0.2... >seem to have a syntax error in my oops.h file. The first line has the syntax >error. It goes like this: > void *new(void *); >And Think C seems to think this is a syntax error. I am just a beginning C >programmer, so I don't really even know if there's a syntax error here or not. >Can anyone help me with this? >Thanx... -- Brendan Duddridge InterNet : umduddr0@ccu.umanitoba.ca America Online : BrendanD1 - ------------------------- From: Carl.Constantine@BCSystems.GOV.BC.CA Subject: Syntax error in OOPS.h Date: 6 Feb 92 07:44:50 -0800 Organization: BC Systems Corporation In article <1992Feb4.184346.22204@ccu.umanitoba.ca>, umduddr0@ccu.umanitoba.ca (Brendan Duddridge) writes: > I am trying to use Object Oriented Programming in Think C 5.0.1. However, I > seem to have a syntax error in my oops.h file. The first line has the syntax > error. It goes like this: > > void *new(void *); > > And Think C seems to think this is a syntax error. I am just a beginning C > programmer, so I don't really even know if there's a syntax error here or not. > Can anyone help me with this? > I think (no pun intended) that this "error" was detected and fixed in TCL 1.1.2. If you don't have it, get (FTP really) the THINK C 5.0.2 update (with TCL 1.1.2) from Sumex-aim.stanford.edu [36.44.0.6]. -- Carl.Constantine@BCSystems.gov.bc.ca British Columbia, Canada --------------------------- From: brunner@brchh87.bnr.ca (James Brunner) Subject: Highlighting a text selection Date: 4 Feb 92 19:43:53 GMT Greetings. Can anyone tell me how to highlight a selection of text in the proper text selection color. In my application, I am not using the TextEdit facility (I need a very large buffer). I have drawn text to the window using DrawText and now, I want to be able to make a selection in the proper color. Do I need a color window? What color do I use? How do I change the background without affecting the text? Any suggestions appreciated. Thanks in advance for your help. -- - ------------------------------------------------------------------------- Jim Brunner - (brunner@brchh87.BNR.CA) All opinions are my own and have nothing whatsoever to do with BNR, NT, NTI, Bell Canada, or any of the BCE corporations or affiliates. - ------------------------- From: jcav@quads.uchicago.edu (JohnC) Subject: Highlighting a text selection Date: 4 Feb 92 20:58:42 GMT Organization: The Royal Society for Putting Things on Top of Other Things In article <6337@brchh104.bnr.ca> brunner@brchh87.bnr.ca (James Brunner) writes: >Greetings. Can anyone tell me how to highlight a selection of text in >the proper text selection color. In my application, I am not using the >TextEdit facility (I need a very large buffer). I have drawn text to the >window using DrawText and now, I want to be able to make a selection in >the proper color. Do I need a color window? What color do I use? How >do I change the background without affecting the text? You're in luck. There are two methods, both of which will auto-magically do The Right Thing. Of course, you do have to be using a color window. Here is some code: Method 1) PROCEDURE SetHiliteMode; INLINE $08B8, $0007, $0938; { bclr #hiliteBit,HiliteMode } ForeColor(blackColor); BackColor(whiteColor); SetHiliteMode; InvertRect(box); When the hilite bit in low-memory bit is cleared, the _next_ drawing command (only), if it is an inverting-type command, will use the user's hilite color instead of inverting. Since Quickdraw resets the bit after each drawing operation, you have to set it up each time you want to hilite. Method 2) ForeColor(blackColor); BackColor(whiteColor); PenPat(black); PenMode(hilite); PaintRect(box); What both methods do is to cause drawing to exchange the background color and the hilight color in the destination, but only in the pixels corresponding to black in the source pattern. All of this is documented in IM 5, p61-62. -- John Cavallino | EMail: jcav@midway.uchicago.edu University of Chicago Hospitals | John_Cavallino@uchfm.bsd.uchicago.edu Office of Facilities Management | USMail: 5841 S. Maryland Ave, MC 0953 B0 f++ c+ g+ k s+(+) e+ h- pv | Chicago, IL 60637 --------------------------- From: ingemar@isy.liu.se (Ingemar Ragnemalm) Subject: Sound Driver vs. Sound Manager Date: 4 Feb 92 09:09:31 GMT Organization: Dept of EE, University of Linkoping How backewards compatible are the Sound Driver routines? Can we still safely use them? For my sound playing needs, I used Sound Manager for a long time, but it gave me a lot of problems: - It is hard to use. It takes *lots* of code to do *anything* except playing a sound synchronously (which is a straight call to SndPlay). Just look at Apple's SoundApp example. It is *huge*. (I also got lots of crashes for a while, since I had debug mode on for the sound module, which included a callback routine.) I've spent hours and hours rewriting my interface to the Sound Manager. - I have to break Apple's rules. Apple says that I must dispose my channel immediately. This gives an unacceptable slowdown on my SE. I want to play the sounds during animations, and the allocation and disposal of channels make it jerky. (Yes, I *do* play unsynchronously.) - If the program quits unexpectedly, the Mac is totally silent until reboot. This isn't acceptable (or at least very annoying) when developing. Isn't there any way to kick Sound Manager awake again? Then I got the idea to try the ancient Sound Driver (IM-2). I hacked my interface in *minutes*. No problems. No callback routines. No jerkyness. A little fix to get rid of the worst "clicking", but the buffer size rule in IM-2 still seems to hold. Having the Mac play melodies was also simple. Sure, square-wave music isn't very impressing, but it takes virtually *no* CPU. I have one question, though: Are there any known *major* problems with the Sound Driver? Once in a great while, my program unexpectedly quits, and I get the feeling that it is more common than before. Since it is so rare, I have no chance to track down the problem. It *might* be Sound Driver. Everyone seems to go for the Sound Manager. Other than going against the majority, do I give myself some big problems in the future? Right now I'm saving time by using Sound Driver instead. Any good reasons why I shouldn't? -- Ingemar Ragnemalm Dept. of Electrical Engineering ...!uunet!mcvax!enea!rainier!ingemar .. University of Linkoping, Sweden ingemar@isy.liu.se - ------------------------- From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy) Subject: Sound Driver vs. Sound Manager Date: 5 Feb 92 15:38:50 GMT Organization: Kalamazoo College ingemar@isy.liu.se (Ingemar Ragnemalm) writes: > [The Sound Manager is...] >- It is hard to use. It takes *lots* of code to do *anything* except playing >a sound synchronously (which is a straight call to SndPlay). Not true, not about the code anyway. You can do a lot with twenty lines of code. >I've spent hours and hours rewriting my interface to the >Sound Manager. Now this I won't dispute. You're not alone in this regard... :-/ >- I have to break Apple's rules. Apple says that I must dispose my channel >immediately. This gives an unacceptable slowdown on my SE. I want to play >the sounds during animations, and the allocation and disposal of channels >make it jerky. (Yes, I *do* play unsynchronously.) Apple recommends immediate channel disposal because an open channel can prevent the rest of the machine from making sound. You should dispose channels whenever you have time. This does _not_ mean that you have to remove old channels the instant they're free. During animation, go ahead and leave one channel open, and play everything through it. >- If the program quits unexpectedly, the Mac is totally silent until reboot. >This isn't acceptable (or at least very annoying) when developing. Isn't >there any way to kick Sound Manager awake again? I understood that this was fixed after system 6.0.5. What machine are you on? Try visiting the Sound control panel and turning the volume off and back on. >I have one question, though: Are there any known *major* problems with the >Sound Driver? Once in a great while, my program unexpectedly quits, and I >get the feeling that it is more common than before. Since it is so rare, >I have no chance to track down the problem. It *might* be Sound Driver. > >Everyone seems to go for the Sound Manager. Other than going against the >majority, do I give myself some big problems in the future? Right now I'm >saving time by using Sound Driver instead. Any good reasons why I shouldn't? Please, please, please, please, please don't use the Sound Driver. Ahem. The reason is: the current Sound Manager has to dedicate a lot of code to supporting the old Sound Driver. Every time you use the Sound Driver on a current system, the 'Manager has to intercept the calls and go into "compatibility mode," where it does Lord knows what to make the archaic functions work. As a side effect, it turns off all sound except what you're doing. (Which is the worst thing that will happen if you leave a channel open anyway...) The good folks up at Apple have a hard enough time writing sound code that works on every Macintosh as it is. This backwards compatibility must be a real drag. Every hour they spend writing code to support the old 'Driver is an hour that's taken away from writing good, solid, useful code for the future. Someday, they'll make the decision to abandon compatibility (probably the day after the Talking Moose is discontinued). Don't do anything that will postpone that day. Ingemar, I have a lot of sample code that may interest you. If you (or anyone else reading) wants it, mail me. -- Jamie McCarthy Internet: k044477@kzoo.edu AppleLink: j.mccarthy Kzoo randomly kills all my mail; if I don't acknowledge, try resending. - ------------------------- From: jmunkki@hila.hut.fi (Juri Munkki) Subject: Sound Driver vs. Sound Manager Date: 5 Feb 92 17:24:04 GMT Organization: Helsinki University of Technology, Finland In article <ingemar.697194571@isy.liu.se> ingemar@isy.liu.se (Ingemar Ragnemalm) writes: >How backwards compatible are the Sound Driver routines? Can we still safely >use them? They still seem to work although at some point Apple promised that the sound driver would go away with System 7.0. >For my sound playing needs, I used Sound Manager for a long time, but it >gave me a lot of problems: It seems to give a lot of people problems. I haven't used it much, but now that IM-VI has documentation that actually makes sense, it is possible to use it. >- It is hard to use. It takes *lots* of code to do *anything* except playing >a sound synchronously (which is a straight call to SndPlay). I think Apple tried too hard to make the sound manager do everything. What we need is a set of managers built on top of the sound manager that will do simple things that need to be done often. In this respect, the Sound Driver was very good: it was simple to use and understandable. >- If the program quits unexpectedly, the Mac is totally silent until reboot. >This isn't acceptable (or at least very annoying) when developing. Isn't >there any way to kick Sound Manager awake again? You could try patching ExitToShell so that it closes your sound stuff correctly. That's what I did with the STORM/Arashi sound kit. >I have one question, though: Are there any known *major* problems with the >Sound Driver? Once in a great while, my program unexpectedly quits, and I >get the feeling that it is more common than before. Since it is so rare, >I have no chance to track down the problem. It *might* be Sound Driver. Using the sound driver will cause problems with other applications. If you know that you are the only application running with the sound driver, you're safe. If two applications attempt to use the sound driver at the same time, you're in trouble. >Everyone seems to go for the Sound Manager. Other than going against the >majority, do I give myself some big problems in the future? Right now I'm >saving time by using Sound Driver instead. Any good reasons why I shouldn't? As I said, the Sound Driver already causes problems. IMHO, these problems can be solved by Apple, but Apple doesn't care about the sound driver any more, since it isn't supported. If you are using a few simple sound effect asynchronously or you want to play music with just a few different notes (sampled), try the STORM/Arashi sound kit. The Sound Kit is available from sumex-aim.stanford.edu and it complies with Think C 5.0. If there's enough demand, I can make a code resource version of it so that you can use it from any development environment. The Sound Kit uses the Sound Driver or the Sound Manager depending on how you set it up. This way you can have either maximum control and speed (with the sound driver) or maximum compatibility (sound manager). Eiher way, the programming interface is the same. The Sound Kit is currently limited to two channels of sampled monophonic sound at 11Khz. I know this is more limiting than the Sound Driver and much more limiting than the Sound Manager, but it's also much easier to use than either of these packages and it provides fairly good sound compression (to save disk space). It's almost ideal for most arcade games. ____________________________________________________________________________ / Juri Munkki / Helsinki University of Technology / Wind / Project / / jmunkki@hut.fi / Computing Center Macintosh Support / Surf / Arashi / ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --------------------------- From: mxmora@unix.SRI.COM (Matt Mora) Subject: What happen to the GNU C compiler for MPW? Date: 4 Feb 92 22:10:01 GMT Organization: SRI International, Menlo Park, CA Where did the GNU C for MPW compiler go? It used to be on ftp.apple.com I thought, but its no longer there. Where did it go? Is it still available? Where can I get it? Thanks Matt -- ___________________________________________________________ Matthew Mora | my Mac Matt_Mora@sri.com SRI International | my unix mxmora@unix.sri.com ___________________________________________________________ - ------------------------- From: johnston@me.udel.edu (Bill Johnston) Subject: What happen to the GNU C compiler for MPW? Date: 5 Feb 92 02:31:00 GMT Organization: University of Delaware/Department of Mechanical Engineering In article <31990@unix.SRI.COM>, mxmora@sri-unix.sri.com (Matt Mora) writes... >Where did the GNU C for MPW compiler go? It used to be on ftp.apple.com >I thought, but its no longer there. Where did it go? GCC and EMACS for aux are available on ftp.apple.com in /pub/gnu. The MPW version is available on sumex-aim.stanford.edu in /info-mac/lang. -- Bill (johnston@me.udel.edu) --------------------------- From: jdt@kepler.unh.edu (Jay D Thomas) Subject: Mac Applications programming Organization: University of New Hampshire - Durham, NH Date: Wed, 5 Feb 1992 03:49:53 GMT I am interested in getting into applications programming for the Mac. I've had some experience programming directly with the toolbox, but it has not been pleasant. I know the languages of C and Pascal but just don't know the standard ways of the Mac to effectively use the toolboox with the languages. Points of confusion are people mentioning MacApp, MPW, Think C, THINk pascal I know that thinkc and think pascal are both compatible with MacApp even though MacApp is a MPW module (object oriented). Should I buy Think C and MacApp, or is that not a good combination? What is the standard way that application programming is done on the macintosh? As I mentioned before, my toolbox experience was quite hellish because of both the incompatibility of the language with it and the fact that there are all these *standard* routines that have to be called in the *right* order. I would like to know how does one avoid this nightmare... surely someone has written a *standard* package that will bring this toolbox up to a higher level (usable!). Another factor here is cost... I can't afford to spend a grand on MPW, Macapp etc!!! I just want to do some programming on the Mac because I enjoy the Mac and programming itself..... Am I out of luck or is there a feasable solution? Sincerly, Jay Thomas - ------------------------- From: orpheus@reed.edu (P. Hawthorne) Subject: Mac Applications programming Organization: Reed College, Portland OR Date: Thu, 6 Feb 1992 08:31:04 GMT jdt@kepler.unh.edu (Jay D Thomas) writes: : I am interested in getting into applications programming for the Mac. : I've had some experience programming directly with the toolbox, but : it has not been pleasant. I know the languages of C and Pascal but just : don't know the standard ways of the Mac to effectively use the toolboox : with the languages. There's the rub. It's not trivial developing Mac applications without having already become versant in using them. Of course, it's not supposed to be the other way around. Mac applications are supposed to be very much a cross between like your mother's worst nightmare and the ideal date in that they are supposed to be easy, reliable, responsive, and megadeep. Fast and sweet never hurt either. This may be somewhat controversial, because you really probably want to be told what development environment to buy, but if time permits, you should use a bunch of good Mac apps to do some hard things first. Adobe, Aldus, Claris and even Microsoft make what I would call the core applications. They are core in that between them, they embody most of the conveniences that makes the Mac a nice platform for doing things on. Many of the programmers who write for those products, however, have no idea what those applications are actually used for. It's a sucker bet in desktop publishing circles that any new version of an Aldus product will have crippled it in at least one Absolutely Critical Respect. The scores of seemingly accidental consistancies that underly Mac apps are known to those who use them much more than people who write them, by and large. PageMaker 4 and FreeHand 3 are evidence enough of that. To develop Mac applications, you first have to learn to use them. A good tutor for this is time and the Mac user interface guide from Apple. : What is the standard way that application programming is done on the : Macintosh? As I mentioned before, my toolbox experience was quite : hellish because of both the incompatibility of the language with it and : the fact that there are all these *standard* routines that have to be : called in the *right* order. I would like to know how does one avoid : this nightmare... surely someone has written a *standard* package that : will bring this toolbox up to a higher level (usable!). The Control and Dialog Managers are amazing kludges, aren't they? That's part of what makes them so very... Well, consistant and modular. Until IBM and Apple port OS/2 to the Mac, (;^) that's just the way it is. I think you are craving an object oriented class library. Whether you develop one yourself or you get one from the big boys, this sounds as if it is definitely the choice for you. The higher level you mention comes from either time and experience, or from a class library. If you are reeking of sulphur and brimstone this early, you should probably go for one. By the way, personally, I use Pascal for most early development because I can read a goofy experimental unit a long time after coding it, whereas I have some difficulty doing the same with C. If I'm not concerned about the clarity of a particular routine, screw C altogether, I use machine code. : Points of confusion are people mentioning MacApp, MPW, Think C, Think : Pascal I know that thinkc and think pascal are both compatible with MacApp : even though MacApp is a MPW module (object oriented). Should I buy Think C : and MacApp, or is that not a good combination? If you were to get Think *, you might not even need MacApp. The Think products come with the Think Class Library (TCL), in either C or Pascal. If one were going to compare it and MacApp, it is spartan and yet it seemed capable of making vanilla applications with relatively little effort. The documentation is really damn good technical writing, IMHO, and serve to clarify a great many of the nuances involved in developing even the simplest apps. The docs are almost better than TCL itself. I would suggest this book as a suitable follow up to the Apple user interface guidelines, since it can reveal the man behind the curtain. Of course, I should mention that you can find books like "Writing Macintosh Applications" and "Macintosh Programming Secrets" and "Using the Macintosh ToolBox in Pascal" and Knuth's Algorithms and so on ad absurdum at your friendly neighborhood technical bookstore. : Another factor here is cost... I can't afford to spend a grand on MPW, : Macapp etc!!! I just want to do some programming on the Mac because I : enjoy the Mac and programming itself..... Am I out of luck or is there a : feasable solution? Who can ignore cost? Your favorite flavor of Think product, including the hearty Think Class Library and some resourceful customer support is God's personal gift to you for just $150. Through mail order, your actual out of pocket expense may plummet earthward. Enjoy, and good luck to you. Theus (orpheus@reed.edu) --------------------------- From: simon@mmpe.mineral.ualberta.ca (Simon Tortike) Subject: Think C v5 and Capps' libraries Organization: University Of Alberta, Edmonton Canada Date: Wed, 5 Feb 1992 06:06:07 GMT I have been able to use the Capps' editor library PE/APP.p all the way up to ThinkC v4.0.x, but now find that recompiling my program under ThinkC v5.0.2 generates a message about the project being incompatable with this version of Think C. Is there any option I can use to make this library work under THinkC v5? I am running system 7.0.1* in 24-bit mode, but with the MODE32 init installed. I should not be surprised if there is no solution, as I had been informed that the editor library is not 32-bit clean. Still, I am not running in 32-bit mode. It would be nice if Capps' could be re-released as a 32-bit product. GFor a product that was not updated at least as long as I had it (since 1988) it has endured remarkably well, especially given that I have generally stayed current in Mac o/s software and in ThinkC. Simon Tortike. Regards, -- W. Simon Tortike, Ph.D., P.Eng. | tel : 403/492-3338 Asst. Prof. of Petroleum Engg. | fax : 403/492-7219 Dept of Min-Met-Pet Engg., | University of Alberta, | Internet: simon@mmpe.mineral.UAlberta.CA Edmonton, AB, CANADA T6G 2G6. | - ------------------------- From: phils@chaos.cs.brandeis.edu (Phil Shapiro) Subject: Think C v5 and Capps' libraries Date: 5 Feb 92 19:44:00 GMT Organization: Symantec Corp. In article <simon.697269967@mmpe.mineral.ualberta.ca> simon@mmpe.mineral.ualberta.ca (Simon Tortike) writes: I have been able to use the Capps' editor library PE/APP.p all the way up to ThinkC v4.0.x, but now find that recompiling my program under ThinkC v5.0.2 generates a message about the project being incompatable with this version of Think C. Is there any option I can use to make this library work under THinkC v5? Try opening up the library (it's a project file) in C 4.0, and then closing it. This should update the project to 4.0 format without losing the project's contents. You can then use this project as a library in C 5.0. I should not be surprised if there is no solution, as I had been informed that the editor library is not 32-bit clean. Still, I am not running in 32-bit mode. It would be nice if Capps' could be re-released as a 32-bit product. Not only isn't CAPPS' 32-bit clean, it's no longer supported. It was officially discontinued about three years ago. If you like, you can purchase the sources to CAPPS directly from Symantec (although it's expensive). A better solution, I think, would be to use a different 3rd party editor package, like Word Solution Engine from DataPak software. You can reach them at (206) 573-9155. I think that Wolfram Research also has an editor toolkit, but I'm not sure. -phil -- Phil Shapiro Technical Support Analyst Language Products Group Symantec Corporation Internet: phils@chaos.cs.brandeis.edu --------------------------- Subject: Logo for the Mac? From: rrw@naucse.cse.nau.edu (Robert Wier) Date: 5 Feb 92 05:58:03 GMT Organization: Northern Arizona University, Flagstaff AZ Hi. I'm not sure if this is the right group for this, but... I'm interested in a shareware/freeware/cheapware version of LOGO for the Mac - We are thinking that we'd like to add some SIMPLE programming to our "Introduction to Algorthms" class. LOGO springs to mind for this. I've searched the net via ARCHIE and have seen LOGO for MSDOS but nothing for the MAC. I'd greatly appreciate any leads on this... THANKS! - Bob Wier ---------- insert favorite standard disclaimers here ---------- home of the mc68hc11 mailing list Northern Arizona University / Flagstaff, Arizona Internet: rrw@naucse.cse.nau.edu | BITNET: WIER@NAUVAX | WB5KXH or uucp: ...arizona!naucse!rrw "I get my kicks on Route 66" - really - I live on it --------------------------- From: dmmg1176@uxa.cso.uiuc.edu (David M Marcovitz) Subject: Mac Programming Primer Update for Think C 5.0 Date: 5 Feb 92 17:51:39 GMT Organization: University of Illinois at Urbana Recently in this group, I saw updates for the Mac Programming Primer on how to change the code to make it compatible with Think C 5.0. Unfortunately, my local system has deleted these notes. Could someone please repost them or tell me where I can get them. Thanks. -- David M. Marcovitz | internet: marcovitz@uiuc.edu Computer-based Education Research Lab | dmmg1176@uxa.cso.uiuc.edu University of Illinois | novanet: marco / cca / nova - ------------------------- From: xxmartn@lims05.lerc.nasa.gov (Jeff Martin) Subject: Mac Programming Primer Update for Think C 5.0 Date: 5 Feb 92 19:26:00 GMT Organization: Electronic Data Systems In article <1992Feb5.175139.15806@ux1.cso.uiuc.edu>, dmmg1176@uxa.cso.uiuc.edu (David M Marcovitz) writes... >Recently in this group, I saw updates for the Mac Programming Primer >on how to change the code to make it compatible with Think C 5.0. >Unfortunately, my local system has deleted these notes. Could someone >please repost them or tell me where I can get them. Thanks. > > >-- >David M. Marcovitz | internet: marcovitz@uiuc.edu >Computer-based Education Research Lab | dmmg1176@uxa.cso.uiuc.edu >University of Illinois | novanet: marco / cca / nova me too please. - --------------- Please reply to xxmartn@lims05.lerc.nasa.gov - --------------- --------------------------- From: cmr45797@uxa.cso.uiuc.edu (Charles Mark Remes) Subject: pascal source to look at Date: 5 Feb 92 20:24:35 GMT Organization: University of Illinois at Urbana I've raided all the programming directories at the popular FTP sites (sumex and rascal) and downloaded all the source code that I could find. I'm a firm believer in learning by example, but the problem is that there isn't much out there ( that I have found). Can someone help me out in finding more pascal source examples? None of the source I downloaded uses many TextEdit calls, and examples of offscreen drawing are not to be found. Perhaps some kind folks on the net would care to share some of their brilliant pascal source with us novices so that we may learn. The easy stuff is simple to wring out of Inside Mac, but some of the more complex things that programmers may want to do (like me) take a bit more experience (of which I am, at the moment, lacking). So, if anyone has code they'd like to share please post it on one of the ftp sites (so everyone can benefit), or email it to me at cmr45797@uxa.cso.uiuc.edu Thanks. -- _____________________________________________________________________ * Chuck Remes * "When Duty whispers 'You must,' * * cmr45797@uxa.cso.uiuc.edu * Youth replies, 'I can.'" * _____________________________________________________________________ - ------------------------- From: CXT105@psuvm.psu.edu (Christopher Tate) Subject: pascal source to look at Date: 5 Feb 92 21:54:50 GMT Organization: Penn State University For examples of lots of nifty techniques, get the "official" Apple sample code from the ftp.apple.com anonymous FTP site. (Sorry; I don't remember the exact path to the sample code....) - ----- Christopher Tate | Cryptogram #20: cxt105@psuvm.psu.edu | CXT105@PSUVM.BITNET | NX GXR VTNNWT KG ROT ZLLZKYM XL EKFZYNM, LXY - -------------------| KR VZHTM ROTV MXUUD ZGN OZYN RX WKUOR. Send me the answer! | --------------------------- From: rdd@cactus.org (Robert Dorsett) Subject: Need routine to convert from double to extended. Date: 5 Feb 92 21:38:48 GMT Organization: Capital Area Central Texas UNIX Society, Austin, Tx I'm looking for a routine to convert a number from THINK C's Universal 12- byte double to the SANE 10-byte Extended format. Any help would be much ap- preciated... - - Robert Dorsett Internet: rdd@cactus.org UUCP: ...cs.utexas.edu!cactus.org!rdd - ------------------------- From: rdd@cactus.org (Robert Dorsett) Subject: Need routine to convert from double to extended. Date: 6 Feb 92 04:21:01 GMT Organization: The Capital Area Central Texas Unix Society In article <10374@cactus.org> rdd@cactus.org (Robert Dorsett) writes: >I'm looking for a routine to convert a number from THINK C's Universal 12- >byte double to the SANE 10-byte Extended format. Any help would be much ap- >preciated... Never mind. The THINK documentation, as usual, was worthless, the Think Reference had incorrect info, and the Apple documentation points one to the Apple Numerics Manual (which I had never justified acquiring). HOWEVER, the SANE.h library under THINK C 5.0 mentions a promising "x96tox80" function, which actually seems to do the job pretty nicely, although I'm awaiting side-effects. So I am now able to use the real object of this exercise, X2Fix, with gleeful abandon...:-) >Robert Dorsett >Internet: rdd@cactus.org >UUCP: ...cs.utexas.edu!cactus.org!rdd Ditto. --------------------------- From: aphelps@vicstoy.UUCP (Austin Phelps) Subject: BinHex 4.0 Date: 5 Feb 92 01:18:13 GMT Organization: vicstoy: Public Access Unix, Orlando, FL Is there a BinHex program that will work on Unix or does this have to be unhexed by a Mac? -- Austin C. Phelps aphelps@vicstoy Pro-Line aphelps@pro-magic Nothing fancy, only limited to 4 lines. - ------------------------- From: Thad.Humphries@p950.f70.n109.z1.FidoNet.Org (Thad Humphries) Subject: BinHex 4.0 Date: 6 Feb 92 03:45:41 GMT AP> From: aphelps@vicstoy.UUCP (Austin Phelps) AP> Newsgroups: comp.sys.mac.programmer AP> Organization: vicstoy: Public Access Unix, Orlando, FL AP> AP> Is there a BinHex program that will work on Unix or does this have to be AP> unhexed by a Mac? If you're talking to UNIX, I've got two suggestions: suntar 1.1 reads and writes Sun formatted 3.5in (1.4MB) diskettes. Does tar/bar very well. There is also a uuencode/uudecode for the Mac. Check the sumex ftp. * Origin: Quis custodiet ipsos custodes? (1:109/70.950) --------------------------- From: Romain.Vignes@fifi.univ-lyon1.fr Subject: Traps question Date: 21 Jan 92 14:45:43 GMT Hi there, In several new header files (THINK C 5.0.1), I found the following definition: pascal void myvoid (int param1, int param2 ...) = {0xADR1,0xADR2,0xADR3} ???????????????????? I don't know why there is 3 (sometimes 2) traps addresses. If somebody could help me ?????????? Thanks Romain Vignes roms@fifi.univ-lyon1.fr - ------------------------- From: bx5x@vax5.cit.cornell.edu Subject: Traps question Date: 21 Jan 92 17:49:50 GMT Organization: Cornell University In article <1992Jan21.144543.6267@fifi.univ-lyon1.fr>, Romain.Vignes@fifi.univ-lyon1.fr writes: > In several new header files (THINK C 5.0.1), I found the following definition: > > pascal void myvoid (int param1, int param2 ...) > = {0xADR1,0xADR2,0xADR3} > ???????????????????? > A lot of the time the trap has a dispatch routine selector or something similar that must be pushed onto the stack before the trap is called. Most likely, the first fex words of hex are the machine code to do this. You will probably find that only the last word of hex is the A-line trap ( you will know because the first hex digit must be an 'A' ). This all depends on which trap it is, of course. Hope this helps. -- - -(0000000000000000000000000000000000000000000000000000000000000000000000)--- ()00 Dave "Rasferet" Blumenthal <aka> bx5x@vax5.cit.cornell.edu 00() Disclaimer: | OK, everybody, | When a hotel owner was asked why he threw I'm a student. | stay in focus. | some loud arrogant chess masters out of I can say what- | -Rowlf the dog, | his lobby, he said, "There's nothing worse ever I want! | The Muppet Movie | than chessnuts boasting in an open foyer." ______________________________________________________________________________ If it works right the first time, the documentation is wrong. - Me ______________________________________________________________________________ ** I'm a .sig virus. Attach me to your .sig! Help me spread! ** - ------------------------- From: ABSURD@applelink.apple.com (Tim Dierks, ToyMeister, Cray abuser) Subject: Traps question Date: 24 Jan 92 01:40:48 GMT Organization: MacDTS, Apple Computer In article <1992Jan21.144543.6267@fifi.univ-lyon1.fr>, Romain.Vignes@fifi.univ-lyon1.fr writes: > > > Hi there, > > In several new header files (THINK C 5.0.1), I found the following definition: > > pascal void myvoid (int param1, int param2 ...) > = {0xADR1,0xADR2,0xADR3} > ???????????????????? Here's a specific example: pascal MenuHandle NewMenu(short menuID,const Str255 menuTitle) = 0xA931; or pascal void SFPutFile(Point where, ConstStr255Param prompt, ConstStr255Param origName, DlgHookProcPtr dlgHook, SFReply *reply) = {0x3F3C,0x0001,0xA9EA}; In hex definitions like this, the values at the end specify certain inline values that should be inserted to call the function. This is created in place of calling a function with a JSR. Often, there is precisely one word (2 bytes) of information, as in the NewMenu() definition. This is used for stack-based traps which have a trap devoted exclusively to them. The one-word value is the A-trap instruction (starts with $A) which is executed to dispatch this trap function. When there is more than one word, there is a little bit of code that must be executed before the trap is called; this usually specifies a selector, either in D0 or on the stack, which selects which function to perform. For example, the SFPutFile example above disassembles to: MOVE.W #$0001,-(A7) | 3F3C 0001 _Pack3 ; A9EA | A9EA As you can see, this pushes the value 1 onto the stack, then executes the trap _Pack3. The other standard files are dealt with similarly, only the selector used is different; the Pack3 code looks at the selector and uses it to decide what code to execute. I hope this information helps; Tim Dierks MacDTS, but I speak for myself - ------------------------- From: keith@Apple.COM (Keith Rollin) Subject: Traps question Date: 28 Jan 92 23:12:36 GMT Organization: Apple Computer Inc., Cupertino, CA In article <1992Jan21.124951.10030@vax5.cit.cornell.edu> bx5x@vax5.cit.cornell.edu writes: >In article <1992Jan21.144543.6267@fifi.univ-lyon1.fr>, >Romain.Vignes@fifi.univ-lyon1.fr writes: >> In several new header files (THINK C 5.0.1), I found the following definition: >> >> pascal void myvoid (int param1, int param2 ...) >> = {0xADR1,0xADR2,0xADR3} >> ???????????????????? >> >A lot of the time the trap has a dispatch routine selector or something >similar that must be pushed onto the stack before the trap is called. >Most likely, the first fex words of hex are the machine code to do this. >You will probably find that only the last word of hex is the A-line trap >( you will know because the first hex digit must be an 'A' ). Some so-called "traps" really are multiple trap calls. Take HLockHi for example (please). The declaration for this function consists of the trap for MoveHHi, and then the trap for HLock. #pragma parameter HLockHi(__A0) pascal void HLockHi(Handle h) = {0xA064,0xA029}; -- - ---------------------------------------------------------------------------- Keith Rollin --- <Taligent .signature under construction> Disclaimer: Pretty soon, I really _won't_ be speaking for Apple... --------------------------- End of C.S.M.P. Digest **********************